/*
 * These files are distributed under the terms of the GNU GPLv2, the GNU General
 * Public version 2. See LICENSE.txt
 */
package fileCommodore.plugin.file_info;

import java.util.*;

import javax.swing.*;

import fileCommodore.model.*;
import fileCommodore.view.*;



/**
 * @author nado18@gmail.com, on Jul 27, 2007
 */
public class RecursiveSizeCounter implements Runnable
{
	private Vector<FileRowItem> items;
	private JLabel label;
	
	public RecursiveSizeCounter(Vector<FileRowItem> items, JLabel label)
	{
		this.items = items;
		this.label = label;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Runnable#run()
	 */
	public void run()
	{
		long size = GroupInfoPane.getRecursiveSize( items );
		String friendly = MyLabelProvider.friendlySize( size );
		label.setText( friendly );
	}
	
}
